home *** CD-ROM | disk | FTP | other *** search
/ Dr. Windows 3 / dr win3.zip / dr win3 / WINWORDS / WE_20N.ZIP / WINEDIT.MN_ < prev    next >
Text File  |  1992-12-02  |  14KB  |  387 lines

  1. ;  AutoExec Section is on top here.  Actually runs before file manager
  2. ; appears on the   screen
  3. ;
  4.         TAB=num2char(9)
  5.         CR=strcat(num2char(13),num2char(10))
  6.         Home=DirHome()
  7. ;
  8. ;       if !WinExist("Clock") then Run("Clock.exe","")
  9. ;
  10. ; customize the toolbar:
  11. ;         ;DEBUG(@ON)
  12. ;         ;WDelButton(9,@WRunCompile)
  13. ;         ;WDelButton(9,@WRunMake)
  14. ;         ;WDelButton(9,@WRunRebuild)
  15. ;         ;WDelButton(9,@WRunDebug)
  16. ;         ;WDelButton(9,@WRunExecute)
  17. ;         ;WDelButton(9,@WPrevError)
  18. ;         ;WDelButton(9,@WNextError)
  19. ;         ;WDelButton(9,@WHlpKeyWord)
  20. ;
  21. ;         WAddButton(@UNDOICON,      @WEDUNDO,      4)
  22. ;         WAddButton(@REDOICON,      @WEDREDO,      5)
  23. ;         WAddButton(@REPEATICON,    @WREPEAT,      10)
  24. ;
  25. ; try a couple of user written functions
  26. ;
  27. ;         WAddButton(@EXECUTEICON,   @WCALL1,       21)
  28. ;         DEBUG(@OFF)
  29. ;        wCallMacro(1)
  30.  
  31. ;;;;; Uncommenting this section give you the WordStar diamond key set.
  32. ;;;;;;You can substitute with your favorite keystrokes
  33. ;WordStar commands                 ; WordStar keyboard command definitions
  34. ; Cursor Left       \ ^S            ; Move cursor one character to the left
  35. ;        WEdLeft()
  36. ; Cursor Right      \ ^D            ; Move cursor one character to the right
  37. ;        WEdRight()
  38. ; Cursor Up         \ ^E            ; Move cursor to previous line
  39. ;        WEdUpLine()
  40. ; Cursor Down       \ ^X            ; Move cursor to next line
  41. ;        WEdDownLine()
  42. ; Home              \ ^A            ; Move cursor to beginning of line
  43. ;        WEdHome()
  44. ; End               \ ^F            ; Move cursor to end of line
  45. ;        WEdEnd()
  46. ; Delete line       \ ^Y            ; Move current line to clipboard
  47. ;        WEdCutLine()
  48.  
  49. Edit WinEdit Utility Menu   ; Manage WinEdit Utility menu and help files
  50.         a=FileLocate("winedit.mnu")
  51.         WFileOpen(a)
  52.         Drop(a)
  53.  
  54. _Key Word Help      \ +{F1}         ; Load help topic for word at cursor
  55.         call("wwwedit.dll","KEYWORDHELP")
  56.  
  57. Load Help File                    ; Load a help file (no keyword lookup)
  58.         TheFile=strcat(DirHome(),"HELP\WEHELP.INI")
  59.         Keys=IniItemizePvt("HelpAll",TheFile)
  60.         KeyMax=ItemCount(Keys,TAB)
  61.         KeyIndex=0
  62.         KeyValues=""
  63.  
  64.         :ieLoop
  65.         if KeyIndex==KeyMax then goto looped
  66.         KeyIndex=KeyIndex+1
  67.         ThisKey=ItemExtract(KeyIndex,Keys,TAB)
  68.         if (stricmp(ThisKey,"DEFAULT")==0) then goto ieloop
  69.         ThisValue=IniReadPvt("HelpAll",ThisKey,"???",TheFile)
  70.         KeyValues=strcat(KeyValues,ThisValue,"|")
  71.         goto ieLoop
  72.         
  73.         :looped
  74.         a=ItemSelect("Select Help File",strlower(KeyValues),"|")
  75.         if a=="" then goto DONE
  76.         b = FileLocate(strcat(DirHome(),"HELP\%a%"))
  77.         if b=="" then b=FileLocate(a)
  78.         if b=="" then Message("Helpfile %a% not found","Edit %TheFile%%CR%[HelpAll] section to%CR%point to help file location%CR%or put helpfile on DOS path.")
  79.                  else WinHelp(b,"CONTENTS","")
  80.         :DONE
  81.         Drop(TheFile,Keys,KeyMax,KeyIndex,KeyValues,ThisKey,ThisValue,a,b)
  82.  
  83. Generate C Tags                   ; Index source files
  84.         ; uses the TAGS.EXE program to generate WINEDIT.MRK file
  85.         ; that the next function uses to look up function names
  86.         ; in your source
  87.         RunWait("TAGS.EXE","-om -tWINEDIT.MRK *.c")
  88.         Message("Tags","Processing complete")
  89.  
  90. Go to tag                         ; Jump to function definition
  91.         ; looks up the current word in WINEDIT.MRK, loads the file,
  92.         ; and moves the cursor to the correct line
  93.         goto START
  94.         :GETWORD
  95.         a = AskLine("Go to tag", "Enter function definition to jump to:", "")
  96.         strupper(a)
  97.         len = strlen(a)
  98.         if len==0 then goto NOWORD
  99.         goto START2
  100.         :START
  101.         a=WEdGetWord()
  102.         strupper(a)
  103.         len = strlen(a)
  104.         if len==0 then goto GETWORD
  105.         :START2
  106.         b=FileLocate("winedit.mrk")
  107.         WFileOpen(b)
  108.         WFind(a,@TRUE,@FALSE)
  109.         WEdHome()
  110.         WEdStartSel()
  111.         WEdEnd()
  112.         WEdEndSel()
  113.         WEdCopy()
  114.         WWinClose()
  115.         line=ClipGet()
  116.         line2=strupper(line)
  117.         c=StrIndex(line2,a,0,@FWDSCAN)
  118.         d=StrIndex(line2," ",c,@FWDSCAN)
  119.         e=StrIndex(line2,"(",d,@FWDSCAN)
  120.         filename=StrSub(line2,d,e-d)
  121.         lineno=StrSub(line2,e+1,strlen(line2)-e-1)
  122.         WFileOpen(filename)
  123.         WEdGoToLine(lineno)
  124.         WEdHome()
  125.         Drop(len,b,line,line2,c,d,e,filename,lineno)
  126.         :NOWORD
  127.         Drop(a)
  128.  
  129.  
  130. Utilities      ;      Select from list of utilities
  131.  &Freespace on Local Drives   ; Display free disk space on drives
  132.  
  133.         Drive=DiskScan(2)     ; 2 is the code for local hard drives
  134.         Dmax=strlen(Drive)
  135.         DIndex=1
  136.         TotalSize=0
  137.         DriveReport=""
  138.  
  139.         :COUNTSPACE
  140.         NextDrive=StrSub(Drive,Dindex,1)
  141.         a=DiskFree(NextDrive)/1024
  142.         TotalSize=a+TotalSize
  143.         DriveReport=strcat(DriveReport,NextDrive," = ",a,"K","@")
  144.         DIndex=Dindex+3  ;each entry is 3 bytes long
  145.         if DIndex<=Dmax then goto COUNTSPACE
  146.         ItemSelect("Total Space Available = %TotalSize%K",DriveReport,"@")
  147.         Drop(xxx,TotalSize,DriveReport,NextDrive,LastDrive)
  148.  
  149.  &Wallpaper                   ; Change the desktop wallpaper
  150.            DirChange(dirWindows(0))
  151.            a=FileItemize("*.BMP")
  152.            a=strcat("-None- ",a)
  153.            a=ItemSelect("Select New Wallpaper",a," ")
  154.            terminate(a=="","Wallpaper","No wallpaper selected")
  155.            if a=="-None-" then Wallpaper("",0)
  156.            if a=="-None-" then exit
  157.            tile=@FALSE
  158.            if FileSize(a)<40000 then tile=@TRUE  
  159.            ;if bmp size less than 40K, assume tile, else center
  160.            Wallpaper(a,tile)
  161.            drop(a,b,tile)
  162.  Edit &INI files              ; Assisted editing of INI files
  163.         DirChange(DirWindows(0))
  164.         canned="BYEBYE"
  165.         IniFiles=""
  166.  
  167.         :UP1
  168.         canned="byebye"
  169.         If IniFiles!="" then goto inied
  170.         IniFiles=FileItemize("*.INI")
  171.         :inied
  172.         TheFile=ItemSelect("Choose Desired INI file",IniFiles," ")
  173.         if TheFile=="" then goto newini
  174.         Sections=""
  175.  
  176.         :UP2
  177.         canned="up1"
  178.         if Sections!="" then goto sected
  179.         Sections=IniItemizePvt("",TheFile)
  180.         :SECTED
  181.         Section=ItemSelect("%TheFile% - Choose Section",Sections,TAB)
  182.         if Section=="" then goto AddSect
  183.         KeyValues=""
  184.  
  185.         :UP3
  186.         canned="up2"
  187.         if KeyValues!="" then goto looped
  188.         Keys=IniItemizePvt(Section,TheFile)
  189.         KeyMax=ItemCount(Keys,TAB)
  190.         KeyIndex=0
  191.  
  192.         :Loop
  193.         if KeyIndex==KeyMax then goto looped
  194.         KeyIndex=KeyIndex+1
  195.         ThisKey=ItemExtract(KeyIndex,Keys,TAB)
  196.         ThisValue=IniReadPvt(Section,ThisKey,"???",TheFile)
  197.         KeyValues=strcat(KeyValues,ThisKey,"= ",ThisValue,TAB)
  198.         goto Loop
  199.  
  200.         :looped
  201.         Key=ItemSelect("%TheFile% [%Section%] - Choose Keyword",KeyValues,TAB)
  202.         if Key=="" then goto AddKey
  203.         Key=ItemExtract(1,Key,"=")
  204.  
  205.         Value=IniReadPvt(Section,Key,"???",TheFile)
  206.         goto entkey
  207.  
  208.  
  209.         :newini
  210.         canned="UP1"
  211.         TheFile=Askline("Making NEW INI file","Enter new INI file name","*.INI")
  212.         if (TheFile=="*.INI" || TheFile=="") then goto newini
  213.         IniFIles=""
  214.         goto AddSectNewIni
  215.  
  216.         :AddSect
  217.         canned="up2"
  218.         :AddSectNewIni
  219.         Section=AskLine("Add New Section to INI File","Enter new section name for%CR%   %TheFile%%CR%      [?????]","")
  220.         Sections=""
  221.         goto AddKeyNewSect
  222.  
  223.         :AddKey
  224.         canned="up3"
  225.         :AddKeyNewSect
  226.         Key=AskLine("Add New Keyword to INI File","Enter new key name for%CR%   %TheFile%%CR%      [%Section%]","")
  227.         Value="(Undefined)"
  228.         KeyValues=""
  229.         goto EntKeyNewKey
  230.  
  231.         :ENTKEY
  232.         canned="up3"
  233.         :EntKeyNewkey
  234.         NewValue=AskLine